var exec = require('cordova/exec');
var pluginName = 'breakdown'
var breakdown = function() {};


/** 
 * 1、开始下载
 *
 * @param {String} url  下载链接
 * @param {Function} progressCallBack   进度回调 下载完成后返回文件地址 
 * @param {Function} errorCallback      失败回调
 */
breakdown.startDown = function(url,progressCallBack,errorCallBack) {

	exec(progressCallBack,errorCallBack,pluginName,"startDownload",[url]);
}


/** 
 * 2、暂停下载
 *
 * @param {String} url  下载链接
 * @param {Function} completeCallback   成功回调
 * @param {Function} errorCallback      失败回调
 */
breakdown.stopDown = function(url,completeCallback,errorCallBack) {

	exec(completeCallback,errorCallBack,pluginName,"stopDownload",[url]);
}

module.exports = breakdown;



// exports.coolMethod = function (arg0, success, error) {
//     exec(success, error, 'breakdown', 'coolMethod', [arg0]);
// };